package com.atguigu.mybatisplus.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author mgx
 * @version 1.0
 * @description: TODO
 * @date 2022/8/20 0:48
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tb_user")
public class User {

    @TableId(value = "id") // 标识这是对应表中的主键
    private Long uid;
    private String name;
    private Integer age;
    private String email;
    // 如果当前属性表中没有就设置@TableField(exist = false)
    private String ai_hao;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @Version
    @TableField(fill = FieldFill.INSERT)
    private Integer version;

    @TableField(fill = FieldFill.INSERT)
    @TableLogic // 表示这是一个逻辑删除字段
    private Integer deleted;
}
